package io.renren.modules.yckj.dao;

import io.renren.common.dao.BaseDao;
import io.renren.modules.yckj.entity.TeamRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 检测关系表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2025-04-17
 */
@Mapper
public interface TeamRelationDao extends BaseDao<TeamRelationEntity> {

    TeamRelationEntity getByTeamIdAndUserId(@Param("teamId") Long teamId, @Param("userId") Long userId);

    List<TeamRelationEntity> getApplyList(@Param("userId") Long userId);


    List<TeamRelationEntity> getRelationList(Map<String, Object> params);

    /**
     * 更新欠款
     *
     * @param id           关系Id
     * @param debtLimitUse 欠款
     * @return 是否成功
     */
    boolean updateDebtLimitUse(@Param("id") Long id, @Param("debtLimitUse") BigDecimal debtLimitUse);

}